#ifndef __XLX_THREAD_H__
#define __XLX_THREAD_H__

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"


//线程回掉
typedef void (*OnTutuThreadCB)(void *parameters);

typedef struct{
    TaskHandle_t thread;
    void* cb;
}TutuThreadHandle;


typedef struct{
    /**
     * @brief 创建线程
     * @param stacksize 栈大小
     * @param name 名称
     * @param priority 优先级
     * @param cb 线程处理函数
     */
   TutuThreadHandle *(*new_thread)(int stacksize, const char *name, int priority, OnTutuThreadCB cb);
   /**
    * @brief 异步释放线程(不可在线程中操作)
    * @param 线程对象
    */
   void (*free_thread)(TutuThreadHandle *handle);

}TutuThread;

//初始化
void TutuThread_Init(TutuThread *myself);

#endif
